<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="../jsLib/angular.js"></script>
    <title></title>
</head>
<body ng-app="app">
<div  ng-controller="Cotrol">
    <td><button ng-click="add()">添加</button></td>
    <td><button ng-click="delete()">删除</button></td>
    <table>
        <tr class="" ng-repeat="item in items">
            <td ng-bind="$index + 1+'.'"> </td>
            <td ng-bind="item.name"> </td>
            <td><button ng-click="alert(item.id)">弹出id</button></td>
        </tr>
    </table>
</div>

  <script >
      var app=angular.module('app',[]);
      app.controller('Cotrol',function($scope){
          var lists=[{name:'bqc',id:1},{name:'cp',id:2},{name:'gdp',id:3},{name:'zh',id:4},{name:'xwp',id:5}];
          $scope.items=lists;
          $scope.add = function(){
              lists.push({name:"new",id:"100"});
          }

          $scope.delete = function(){
              lists.pop({name:"new"});
          }

          $scope.alert= function(item){
              alert(item)
          }
      })
  </script>
</body>
</html>